#ifndef GYRO_FLOW_PORT_STABLIZATION_PARAM_H
#define GYRO_FLOW_PORT_STABLIZATION_PARAM_H


#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>

// Define Vector4 structure in C
typedef struct {
    float x, y, z, w;
} Vector4;

// Define BackgroundMode enumeration in C
typedef enum {
    SolidColor = 0,
    RepeatPixels = 1,
    MirrorPixels = 2,
    MarginWithFeather = 3
} BackgroundMode;

// Define BTreeMap structure in C (simplified version)
typedef struct {
    // Define fields of BTreeMap here
} BTreeMap;

// Define StabilizationParams structure in C
typedef struct {
    // Processing input size
    size_t size_x;
    size_t size_y;

    // Processing output size
    size_t output_size_x;
    size_t output_size_y;

    // Full resolution input size
    size_t video_size_x;
    size_t video_size_y;

    // Full resolution output size
    size_t video_output_size_x;
    size_t video_output_size_y;

    Vector4 background;
    double frame_readout_time;
    double adaptive_zoom_window;
    double adaptive_zoom_center_offset_x;
    double adaptive_zoom_center_offset_y;
    int32_t adaptive_zoom_method;
    double fov;
    bool fov_overview;
    bool show_safe_area;

    // Define a simplified dynamic array for fovs and minimal_fovs
    double* fovs;
    size_t fovs_length;
    double* minimal_fovs;
    size_t minimal_fovs_length;

    double min_fov;
    double fps;
    //播放快慢倍速
    double* fps_scale;
    double video_speed;
    bool video_speed_affects_smoothing;
    bool video_speed_affects_zooming;

    // Define a simplified dynamic array for speed_ramped_timestamps
    BTreeMap* speed_ramped_timestamps;
    size_t speed_ramped_timestamps_length;

    size_t frame_count;
    double duration_ms;
    double trim_start;
    double trim_end;
    double video_rotation;
    double lens_correction_amount;
    BackgroundMode background_mode;
    double background_margin;
    double background_margin_feather;
    bool framebuffer_inverted;
    bool is_calibrator;
    bool stab_enabled;
    bool show_detected_features;
    bool show_optical_flow;
    uint32_t of_method;
    int32_t current_device;

    // Define a simplified dynamic array for zooming_debug_points
    BTreeMap* zooming_debug_points;
    size_t zooming_debug_points_length;
} StabilizationParams;

StabilizationParams create_default_stabilization_params();

#endif //GYRO_FLOW_PORT_STABLIZATION_PARAM_H
